package org.csmzxy.class2333;

public class Student1_07 {
    public String name;
    public int age;
    //无参构造方法
    public Student1_07(){
        System.out.println("实例化了一个新的Student对象");
    }
    public Student1_07(String name){
        this.name="小王";
    }
    public Student1_07(String name, int age){
        //使用this()调用构造方法，想调用哪个就填写里面的参数
        this(name);
        this.age=age;
    }
    public void print3(){
        System.out.println("我是" + name +",年龄"+age);

    }
}
